<?php


namespace app\common\exception;


use app\common\constant\ErrorNum;
use Throwable;

class AppException extends \Exception
{
    public function __construct($message = "ok", $code = 0, Throwable $previous = null)
    {
        if (is_null($message)) {
            $message = (new \app\common\constant\ErrorNum)->getInstance()->getMessage($code);
        }
        parent::__construct($message, $code, $previous);
    }
}